#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/15 17:59
# @Author: 刘航
# @Email: xxx@gmail.com
# @File：cule_poll_page.py
"""
线索池模块
"""
from pages.base_page import BasePage
from selenium.webdriver.common.by import By
class CulePoolPage(BasePage):
    first_cule_pool_locator = (By.XPATH, "/html/body/div[5]/div[2]/div[2]/form/table/tbody/tr[1]")
    first_cule_pool_column_data = (By.TAG_NAME, "td")
    receive_cule_pool_locator = (By.CSS_SELECTOR,".table > tbody:nth-child(3) > tr:nth-child(1) > td:nth-child(10) > a:nth-child(4)")

    def first_cule_pool_data(self):
        """线索池第一条线索数据"""
        element = self.driver.find_element(*self.first_cule_pool_locator)
        data = element.find_elements(*self.first_cule_pool_column_data)
        return data
    def receive_cule_pool(self):
        """领取线索池第一条数据的领取"""
        self.driver.find_element(*self.receive_cule_pool_locator).click()